package com.weimob.mcloud.wechatwork.customer.service.user.enums;

import lombok.Getter;

/**
 * 订单取消类型
 * @author yu liu
 * @date 2021/2/24
 * @since v5.2
 */
public enum OrderCancelTypeEnum {

    CUSTOMER(1, "用户取消"),
    BUSINES(2, "商家取消"),
    AUTO(3, "系统自动取消")
    ;

    @Getter
    private Integer code;

    @Getter
    private String value;

    OrderCancelTypeEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getValueByCode(Integer code){
        for (OrderCancelTypeEnum orderCancelTypeEnum : OrderCancelTypeEnum.values()){
            if (orderCancelTypeEnum.getCode().equals(code)){
                return orderCancelTypeEnum.getValue();
            }
        }
        return null;
    }
}
